package com.cnebula.dataprocess.sqoop.job;

import javax.annotation.Resource;

import org.apache.rocketmq.spring.starter.core.RocketMQTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class App {
	
	private static final Logger logger = LoggerFactory.getLogger(App.class);
	
	@Resource
    private RocketMQTemplate rocketMQTemplate;
	
    public static void main(String[] args) throws InterruptedException {
        
        ApplicationContext ctx = new SpringApplicationBuilder().sources(App.class).run(args);
        
//        RocketMQTemplate rocketMQTemplate = ctx.getBean(RocketMQTemplate.class);
//        
//        DataSourceNode node = new DataSourceNode();
//        node.setHost("222.29.81.136");
//        node.setPort(3306);
//        node.setCharset("utf-8");
//        node.setDbType("mysql");
//        node.setDatabase("_510500");
//        node.setUsername("root");
//        node.setPassword("calis123");
//        node.setSql("select * from test_goods");
//        node.setPartition("id");
//        
//        rocketMQTemplate.convertAndSend("datanode-topic", node);
    }
}
